
pkgname=fakeroot
pkgver=1.20.2
pkgrel=4
pkgdesc="Gives a fake root environment, useful for building packages as a non-privileged user."
arch=('x86_64')
license=('GPL')
url="http://packages.debian.org/fakeroot"
groups=('base-devel')
install="fakeroot.install"
depends=('glibc' 'filesystem' 'util-linux' 'sed' 'sh')
options=('!libtool')
source=("http://ftp.debian.org/debian/pool/main/f/fakeroot/${pkgname}_${pkgver}.orig.tar.bz2"
        "dlsym.patch")
md5sums=('a4b4564a75024aa96c86e4d1017ac786'
         '62f6a56ee03486d2d8d178b922c612cd')

build() {
  cd ${pkgname}-${pkgver}
  patch -p1 -i $srcdir/dlsym.patch

  #./bootstrap
  ./configure --prefix=/usr \
        --libdir=/usr/lib/libfakeroot \
        --disable-static \
        --with-ipc=sysv

  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
  
  install -d -m755 ${pkgdir}/etc/ld.so.conf.d
  echo '/usr/lib/libfakeroot' > ${pkgdir}/etc/ld.so.conf.d/fakeroot.conf
  
  install -D -m644 ${srcdir}/${pkgname}-${pkgver}/README ${pkgdir}/usr/share/doc/${pkgname}/README
}

